package com.chen.bpsptsystem.controller.manger;

import com.chen.bpsptsystem.common.ServerResponse;
import com.chen.bpsptsystem.po.Interest;
import com.chen.bpsptsystem.service.IInterestService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author chen
 * <p>
 * 兴趣分类
 */
@RestController
@RequestMapping("/back/interest/")
public class InterestController {

    @Resource
    private IInterestService interestService;

    @PostMapping("add")
    public ServerResponse add(@RequestBody Interest interest) {
        return interestService.add(interest);
    }

    @GetMapping("list")
    public ServerResponse list() {
        return interestService.list();
    }

    @PostMapping("delete")
    public ServerResponse delete(Integer id) {
        return interestService.delete(id);
    }

    @PostMapping("edit")
    public ServerResponse edit(@RequestBody Interest interest) {
        return interestService.edit(interest);
    }
}
